package com.dzm.controller;

import com.dzm.anno.RequiresPermissions;
import com.dzm.entity.Classes;
import com.dzm.service.ClassesService;
import com.dzm.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 作者：Dzm
 * 时间：2024-08-21-11:04
 * 功能：
 */

@RestController
@RequestMapping("/api/classes")
public class ClassesController {
    @Autowired
    private ClassesService classesService;

    @RequiresPermissions("classes:list")
    @GetMapping("/list")
    public R list() {
        List<Classes> list = classesService.list();
        return R.ok().data("list", list);
    }
}
